#!/bin/sh

# Remove the broken vendor ipkg installation
rm -rf /bin/ipkg /etc/ipkg.conf* /usr/lib/ipkg

# Add %OPTWARE_TARGET_PREFIX%/bin and %OPTWARE_TARGET_PREFIX%/sbin to the path
touch /etc/profile
if ! grep '^PATH=.*%OPTWARE_TARGET_PREFIX%/bin' /etc/profile >/dev/null 2>&1 ; then
  echo "PATH=\$PATH:%OPTWARE_TARGET_PREFIX%/bin:%OPTWARE_TARGET_PREFIX%/sbin" >> /etc/profile
fi
